home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / sgml / sgml2latex-format.1.3.tar.Z / sgml2latex-format.1.3.tar / doc / qwertz.sgml < prev   
SGML Document  |  1993-11-24  |  77KB

  1. <!doctype qwertz system [
  2. <!entity LaTeX sdata "{\LaTeX}">
  3. <!entity TeX sdata "{\TeX}" >
  4. <!entity et "&etago;">
  5. <!entity bigcup "<mc>\bigcup</>">
  6. <!entity l "[">
  7. <!entity r "]">
  8. ]>
  9.  
  10. <chapt>The <tt>qwertz</> Document Type Definition
  11.  
  12. All of the <tt>qwertz</> document "styles", except bibliographies, 
  13. are defined in a single SGML document type
  14. definition (DTD), called
  15. <tt>qwertz</>.  It is essentially a SGML reconstruction of  Lamport's &LaTeX 
  16. <cite id="Lamport86">.  We have not attempted to include every feature
  17. of &LaTeX in this DTD, but have included the features we use
  18. regularly.  Others may of course find that something they deem
  19. important is missing.  We welcome suggestions for improvements or
  20. extensions.
  21.  
  22. We will be making use of several <em/parameter entities/ in this
  23. DTD:
  24.  
  25. <p>
  26. <code>
  27. <!entity % emph 
  28.     " em | it | bf | sf | sl | tt " >
  29.  
  30. <!entity % xref
  31.     " label | ref | pageref | cite | ncite " >
  32.  
  33. <!entity % inline 
  34.     " (#pcdata | f | x | %emph; | sq | %xref)* " >
  35.  
  36. <!entity % list 
  37.         " list | itemize | enum | descrip " >
  38.  
  39. <!entity % par     
  40.     "  %list; | comment | lq " >
  41.  
  42. <!entity % mathpar " dm | eq " >
  43.  
  44. <!entity % thrm 
  45.         " def | prop | lemma | coroll | proof | theorem " >
  46.  
  47. <!entity % litprog " code | verb " >
  48.  
  49. <!entity % sectpar 
  50.         " %par; | figure | tabular | table | %mathpar; | 
  51.       %thrm; | %litprog; ">
  52. </code>
  53.  
  54. These are just macros used in the definitions of various elements,
  55. to avoid retyping and to ease maintenance.  The <tt/emph/ parameter
  56. lists the various kinds of emphasis.  The <tt/inline/ parameter is for
  57. the elements which may be used anywhere within the document. The
  58. <tt/list/ parameter is for various kinds of lists.  <tt/par/ lists
  59. several basic kinds of elements at the level of paragraphs.  The
  60. <tt>mathpar</> parameter includes the elements for <em/displayed/
  61. mathematical formulas.  The <tt>thrm</> parameter is for the set of
  62. elements used to represent such things as definitions, theorems and
  63. proofs.  The <tt>litprog</> parameter is for literate programming
  64. elements.  Finally, the <tt>sectpar</> parameter lists the elements
  65. which may occur at the level of paragraphs within sections (or
  66. chapters).  Notice that this parameter uses other parameters.
  67.  
  68. Several kinds of documents may be written using &LaTeX: articles,
  69. reports, books, letters and slide (or transparency) presentations.  The <tt/qwertz/ DTD 
  70. includes two others as well:  <tt/notes/, for documents such as notes to yourself which do not
  71. require a title, sections, footnotes and the like; and <tt/manpage/, for Unix manual pages.
  72.  
  73. <code>
  74. <!element qwertz o o 
  75.         (sect | chapt | article | report | 
  76.      book | letter | telefax | slides | notes | manpage ) >
  77. </code>
  78.  
  79. Notice that sections (<tt>sect</>) and chapters (<tt>chapt</>) may
  80. also be processed separately, before being put together into an
  81. article, report or book.
  82.  
  83. &LaTeX also includes Bib&TeX, a program for creating
  84. bibliographies whose entries can be easily cited in &LaTeX documents.
  85. The <tt/qwertz/ document type for this purpose is described in Chapter 5.
  86.  
  87. <sect>General Purpose Entities and Elements</>
  88.  
  89. <p> This section describes the SGML entities and elements available in
  90. all <tt/qwertz/ documents. 
  91.  
  92. <code>
  93. <!entity % general system -- general purpose characters -- >
  94. %general;
  95. </code>
  96.  
  97. <sect1>Characters Entities</>
  98.  
  99. <p>
  100. Most characters are created just by typing the character wanted on
  101. the keyboard.  This simple method does not suffice when the character
  102. wanted isn't in the character set available, or at least not
  103. associated with a key on the keyboard, or when the character currently
  104. has special meaning to SGML or, perhaps, &TeX;. In this section, a
  105. fairly large number of general purpose character entities will be
  106. presented.  Symbols and characters which may be used only in
  107. mathematical formulas will be discussed separately, in section <ref
  108. id="math">.
  109.  
  110.  When may it be necessary to use of an entity reference to produce
  111. some character?  There are three cases to watch out for:
  112.  
  113. <descrip>
  114. <tag>SGML Concrete Syntax Delimiters.</>
  115.  
  116.  Although the SGML standard allows alternative concrete syntaxes to
  117. be defined, we use the so-called <em>reference concrete syntax</> in
  118. the <tt>qwertz</> document types.  In this reference syntax, < is
  119. the <em>start tag open</> character, and <tt></</> is the <em>end
  120. tag open</> delimiter.  The other SGML delimiter authors should be
  121. aware of is &, the <em>entity reference open</> delimiter of the
  122. reference syntax. 
  123.  
  124.  The appropriate entity to use to generate these characters depends
  125. on the context.  Normally, use <tt>lt</> to represent < and
  126. <tt>amp</> to get &, when these appear in strings which might
  127. otherwise be interpreted as starting tags or entity references.
  128. However, within the <tt>code</> or <tt>verb</> elements for literate
  129. programming, described in section <ref id="litprog">, use the
  130. <tt>ero</> entity to represent & and the <tt>etago</> entity for
  131. the sequence <tt>&etago</>.
  132.  
  133. <verb>
  134. <!entity   lt    sdata "<" >
  135. <!entity   amp   sdata "&" >
  136. <!entity   ero   sdata "&ero;" >
  137. <!entity   etago sdata "&etago;" >
  138. </verb>
  139.  
  140. <tag>SGML Short Reference Delimiters.</>
  141.  
  142. In SGML document types <em>short reference maps</> may be defined
  143. which allow single characters to be interpreted as arbitrarily complex
  144. sequences of characters, including SGML tags and entity references.
  145. Thus, to know precisely when a certain character will be interpreted
  146. literally or as a short reference (i.e. macro) for something else, one
  147. has to know which map is in effect in the context of the current
  148. element.  Just about all punctuation characters which are not used as
  149. delimiters in the concrete syntax can be used as short reference
  150. delimiters:
  151.  
  152. <verb>
  153. " # % ' ( ) * + , - : ; = @ [ ] ^ _ { | } ~
  154. </verb>
  155.  
  156. For each of these characters, there is an SGML entity which may be
  157. used to generate the ASCII character in the printed document, listed
  158. in table <ref id="GPC">. <em>Usually, it will not be necessary to use these
  159. entities; the character can simply be typed and will be interpreted
  160. literally.</> However, if the results are not as expected, check to
  161. see if there is a map in effect at that point in the document in which
  162. the character has been redefined.  As maps are associated with
  163. elements, the section in this manual describing an element will also
  164. direct you to a description of the applicable map, if there is one.
  165.  
  166. As it turns out, one important use of character maps is to generate
  167. exactly the character typed in the printed document.  That is, the map
  168. is used to hide the special meaning of the character to the underlying
  169. formatter (e.g. &TeX;), replacing the character with the formatting
  170. instructions for generating the character.  This has been the main use
  171. of maps in our <tt>qwertz</> document type definitions.  
  172.  
  173. <verb>
  174. <!entity   dquot sdata "&dquot;" >
  175. <!entity   num  sdata "#"    >
  176. <!entity   percnt sdata "%" >
  177. <!entity   quot sdata """  >
  178. <!entity   lpar sdata "("   >
  179. <!entity   rpar sdata ")"   >
  180. <!entity   ast  sdata "*"    >
  181. <!entity   plus sdata "+"   >
  182. <!entity   comma sdata "," >
  183. <!entity   hyphen sdata "‐"  >
  184. <!entity   colon sdata ":" >
  185. <!entity   semi  sdata ";"  >
  186. <!entity   equals sdata "=" >
  187. <!entity   commat sdata "@" >
  188. <!entity   lsqb  sdata "["  >
  189. <!entity   rsqb  sdata "]"  >
  190. <!entity   circ sdata "ˆ"   >
  191. <!entity   lowbar sdata "_" >  
  192. <!entity   lcub  sdata "{"     >
  193. <!entity   verbar sdata "|" >
  194. <!entity   rcub  sdata "}"    >
  195. <!entity   tilde sdata "˜"   >
  196. </verb>
  197.  
  198. <tag>&TeX Special Characters.</>
  199.  
  200. Ideally, it should be possible to hide the conventions of the
  201. underlying formatting system completely.  In fact, SGML parsers which
  202. implement the full ISO standard have a feature which makes this
  203. possible.  However, the SGML parser we are using does not include this
  204. feature: the only characters which can serve as short references are
  205. the characters allowed for this purpose by the reference concrete
  206. syntax.  Unfortunately, this reference syntax does not allow &,
  207. &dollar and &bsol to be used as short references, which are all
  208. special &TeX characters.  Thus, the entities for these three
  209. characters (<tt>amp, dollar</> and <tt>bsol</>) must usually be used
  210. to produce them. (The &dollar and &bsol characters may be used
  211. directly within the <tt>verb</> and <tt>code</> elements, discussed
  212. below in section <ref id="litprog">.  Also, within these elements use
  213. the <tt>ero</> entity to represent & in strings which might
  214. otherwise be interpreted as entity references.)
  215.  
  216. <verb>
  217. <!entity   bsol sdata "\" >
  218. <!entity   dollar sdata "$"     >
  219. </verb>
  220.  
  221. </descrip>
  222.  
  223. <sect1>Spacing, Dashes and Ellipsis</>
  224.  
  225. <p>The meaning of the ordinary space character is context sensitive.
  226. Sometimes there is a space <em>within</> a single word.  Such spaces
  227. can be typed using the <em>nonbreakable space</> (<tt>nbsp</>) entity
  228. to avoid breaking the word at that point at the end of line.  There
  229. are also contexts where one wants a certain amount of space to appear,
  230. without it being regarded by the formatter as being space which may be
  231. shrunk in order to clean-up the arrangement of words or characters on
  232. the line.  There are three entities for this purpose: <tt>emsp</>
  233. denotes the amount of horizontal space required for the character "M".
  234. An <tt>ensp</> is just half as wide as an <tt>emsp</>, and a <em>thin
  235. space</> (<tt>thinsp</>) is <f>1/6</> of an <tt>emsp</>.  Notice that
  236. these are relative amounts, depending on the font being used.
  237.  
  238.  There are also three different kinds of dashes: <tt>hyphen</>, which
  239. was already mentioned above, is to be used for intra-word dashes, as
  240. in the word "intra-word".<footnote>However, the <tt>hyphen</> entity
  241. was not actually necessary here, as the - character was not being used
  242. in this context as a short reference.</footnote> <tt>ndash</> is to be
  243. used for number ranges, such as "23–56", and <tt>mdash</> is an
  244. alternative delimiter for parenthetical comments &mdash certainly
  245. you've seen them used this way &mdash perhaps to avoid too frequent
  246. use of commas or parentheses.
  247.  
  248. <verb>
  249. <!entity   nbsp sdata  " " >
  250. <!entity   emsp sdata " " >
  251. <!entity   ensp sdata " " >
  252. <!entity   thinsp sdata " " >
  253. <!entity   mdash sdata "—" >
  254. <!entity   ndash sdata "–" >
  255. <!entity   hellip sdata "…" >
  256. </verb>
  257.  
  258. <sect1>Foreign Languages</>
  259.  
  260. <p>
  261.  There are a large set of entities for other Western European
  262. languages.  Altogether, there are entities for almost all of the
  263. foreign language characters in ISO 8859, the Latin 1 character set for
  264. Western European languages.<footnote>Only the four Icelandic
  265. characters are missing.</> Conveniently, these entities are all
  266. available in the usual Adobe PostScript fonts, as well as in &TeX;.
  267. Thus, all of the entities defined here can be printed in &TeX;, on
  268. PostScript printers, or displayed on any Latin 1 device.  Depending on
  269. the computer and editor, it may also be possible to type these Latin 1
  270. characters directly, instead of having to use these entities.  A
  271. simple filter could translate Latin 1 files into ASCII files,
  272. replacing non-ASCII characters by entity references. The entity names
  273. chosen here for these characters conform to the SGML standard.
  274.  
  275. <verb> 
  276. <!entity aacute  sdata 'á' >
  277. <!entity Aacute  sdata 'Á' >
  278. <!entity acirc   sdata 'â'  >
  279. <!entity Acirc     sdata 'Â'  >
  280. <!entity agrave  sdata 'à' >
  281. <!entity Agrave  sdata 'À' >
  282. <!entity aring   sdata 'å'  >
  283. <!entity atilde  sdata 'ã' >
  284. <!entity Atilde  sdata 'Ã' >
  285. <!entity auml    sdata 'ä'   >
  286. <!entity Auml    sdata 'Ä'   >
  287. <!entity aelig   sdata 'æ'  >
  288. <!entity AElig   sdata 'Æ'  >
  289. <!entity ccedil  sdata 'ç' >
  290. <!entity Ccedil  sdata 'Ç' >
  291. <!entity eacute  sdata 'é' >
  292. <!entity Eacute  sdata 'É' >
  293. <!entity ecirc   sdata 'ê'  >
  294. <!entity egrave  sdata 'è' >
  295. <!entity Egrave  sdata 'È' >
  296. <!entity euml    sdata 'ë'   >
  297. <!entity Euml    sdata 'Ë'   >
  298. <!entity iacute  sdata 'í' >
  299. <!entity Iacute  sdata 'Í' >
  300. <!entity icirc   sdata 'î'  >
  301. <!entity Icirc   sdata 'Î'  >
  302. <!entity igrave  sdata 'ì' >
  303. <!entity Igrave  sdata 'Ì' >
  304. <!entity iuml    sdata 'ï'   >
  305. <!entity Iuml    sdata 'Ï'   >
  306. <!entity ntilde  sdata 'ñ' >
  307. <!entity Ntilde  sdata 'Ñ' >
  308. <!entity oacute  sdata 'ó' >
  309. <!entity Oacute  sdata 'Ó' >
  310. <!entity ocirc   sdata 'ô'  >
  311. <!entity Ocirc   sdata 'Ô'  >
  312. <!entity ograve  sdata 'ò' >
  313. <!entity Ograve  sdata 'Ò' >
  314. <!entity oslash  sdata 'ø' >
  315. <!entity Oslash  sdata 'Ø' >
  316. <!entity otilde  sdata 'õ' >
  317. <!entity ouml    sdata 'ö'   >
  318. <!entity Ouml    sdata 'Ö'   >
  319. <!entity szlig   sdata 'ß'  >
  320. <!entity uacute  sdata 'ú' >
  321. <!entity Uacute  sdata 'Ú' >
  322. <!entity ucirc   sdata 'û'  >
  323. <!entity ugrave  sdata 'ù' >
  324. <!entity Ugrave  sdata 'Ù' >
  325. <!entity uuml    sdata 'ü'   >
  326. <!entity Uuml    sdata 'Ü'   >
  327. <!entity yacute  sdata 'ý' >
  328. <!entity Yacute  sdata 'Ý' >
  329. <!entity yuml    sdata 'ÿ'   >
  330. </verb>
  331.  
  332. The <tt>qwertz</> document types were developed in a German research
  333. center, so we have included entities for the German characters with
  334. shorter names than the entity names used in the SGML standard.  Notice
  335. that these are just synonyms for the standard entities, which are also
  336. included.
  337.  
  338.  
  339. <code>
  340. <!entity   Ae  '&ero;Auml;' >
  341. <!entity   ae  '&ero;auml;' >
  342. <!entity   Oe  '&ero;Ouml;' >
  343. <!entity   oe  '&ero;ouml;' >
  344. <!entity   Ue  '&ero;Uuml;' >
  345. <!entity   ue  '&ero;uuml;' >
  346. <!entity   sz  '&ero;szlig;' >
  347. </code>
  348.  
  349. <sect1>Other Symbols</>
  350.  
  351. <p>
  352. Finally, there are entities for a few miscellaneous symbols,
  353. such as §, ¶, ©, ¬, ÷, ±, ×, and
  354. μ.  All of these entities name symbols in the Latin 1 character
  355. set.  They may be used anywhere within a document. (In particular, the
  356. mathematical symbols shown here need not be within one of the formula
  357. elements described below, in section <ref id="math">.)  The entity
  358. names for these, and all the other character entities discussed above,
  359. are listed in table <ref id="GPC">.   <em/A document which does not
  360. include mathematical formulas or graphics and which uses only the character
  361. entities defined in this chapter can be displayed or printed using a
  362. single Latin 1 font/.
  363.  
  364. <verb>
  365. <!entity   gt     sdata ">" >
  366. <!entity   sect   sdata "§">
  367. <!entity   para   sdata "¶">
  368. <!entity   copy   sdata "©">
  369. <!entity   iexcl  sdata "¡" >
  370. <!entity   iquest sdata "¿" >
  371. <!entity   cent   sdata "¢" >
  372. <!entity   pound  sdata "£" >
  373. <!entity   not    sdata "¬" >
  374. <!entity   divide sdata "÷" >
  375. <!entity   plusmn sdata "±" >
  376. <!entity   times  sdata "×"  >
  377. <!entity   mu     sdata "μ" >
  378. </verb>
  379.  
  380.  
  381. <table>
  382. <tabular ca="ll|ll|ll|ll">
  383. AElig   |    Æ  |
  384. Aacute  |    Á |
  385. Acirc    |    Â  |
  386. Ae      |     &Ae    @
  387. Agrave  |    À |
  388. Atilde  |    Ã |
  389. Auml    |    Ä   |
  390. Ccedil  |    Ç @
  391. Eacute  |    É |
  392. Egrave  |    È |
  393. Euml    |    Ë   |
  394. Iacute  |    Í @
  395. Icirc   |    Î  |
  396. Igrave  |    Ì |
  397. Iuml    |    Ï   |
  398. Ntilde  |    Ñ @
  399. Oacute  |    Ó |
  400. Ocirc   |    Ô  |
  401. Oe      |       &Oe     |
  402. Ograve  |    Ò @
  403. Oslash  |    Ø |
  404. Ouml    |    Ö   |
  405. Uacute  |    Ú |
  406. Ue      |       &Ue     @
  407. Ugrave  |    Ù |
  408. Uuml    |    Ü   |
  409. Yacute  |    Ý |
  410. aacute  |    á @
  411. acirc   |    â  |
  412. ae      |       &ae    | 
  413. aelig   |    æ  |
  414. agrave  |    à @
  415. amp     |       &    |
  416. aring   |    å  |
  417. ast     |       &ast    | 
  418. atilde  |    ã @
  419. auml    |    ä   |
  420. bsol    |       &bsol   | 
  421. ccedil  |    ç |
  422. cent    |       ¢   @
  423. circ    |       &circ   |
  424. colon   |       &colon  | 
  425. comma   |       &comma  | 
  426. commat  |       &commat @
  427. copy    |       ©   |
  428. divide  |       ÷ |
  429. dollar  |       &dollar |
  430. dquot   |       &dquot  @ 
  431. eacute  |    é |
  432. ecirc   |    ê  |
  433. egrave  |    è |
  434. emsp    |               @
  435. ensp    |               | 
  436. equals  |       &equals | 
  437. euml    |    ë   |
  438. gt      |       >     @
  439. hellip  |       &hellip | 
  440. hyphen  |       &hyphen |
  441. iacute  |    í |
  442. icirc   |    î  @
  443. iexcl   |       ¡  |
  444. igrave  |    ì |
  445. iquest  |       ¿ | 
  446. iuml    |    ï   @
  447. lcub    |       &lcub   | 
  448. lowbar  |       &lowbar |
  449. lpar    |       &lpar   | 
  450. lsqb    |       &lsqb   @ 
  451. lt      |       <     | 
  452. mdash   |       &mdash  |
  453. mu      |       &mu     | 
  454. nbsp    |               @
  455. ndash   |       &ndash  |
  456. not    |       ¬    |
  457. ntilde  |    ñ |
  458. num     |       &num    @ 
  459. oacute  |    ó |
  460. ocirc   |    ô  |
  461. oe      |       &oe     | 
  462. ograve  |    ò @
  463. oslash  |    ø |
  464. otilde  |    õ |
  465. ouml    |    ö   |
  466. para    |       ¶   @ 
  467. percnt  |       &percnt |
  468. plus    |       &plus   |
  469. plusmn  |       ± | 
  470. pound   |       £  @ 
  471. quot    |       "   |
  472. rcub    |       &rcub   |
  473. rpar    |       &rpar   |
  474. rsqb    |       &rsqb   @
  475. sect    |       §   |
  476. semi    |       &semi   |
  477. sz      |       &sz     | 
  478. szlig   |    ß  @
  479. thinsp  |             |
  480. tilde   |       &tilde  |
  481. times   |       ×  |
  482. uacute  |    ú @
  483. ucirc   |    û  |
  484. ue      |       &ue     | 
  485. ugrave  |    ù |
  486. uuml    |    ü   @
  487. verbar  |       &verbar |
  488. yacute  |    ý |
  489. yuml    |    ÿ   |
  490. </tabular>
  491. <caption><label id="GPC">General Purpose Characters</caption>
  492. </table>
  493.  
  494. <sect1>Sentences, Paragraphs, Emphasis and Quotations
  495.  
  496. <p>
  497. Sentences need not be marked up with tags.  There is no
  498. <tt>sentence</> element as such.  Rather, these are marked implicitly
  499. using the usual conventions for beginning and ending sentences.
  500.  
  501. Paragraphs are delimited with the <tt/p/ tag.  Both the starting tag
  502. and ending tag are optional.
  503.  
  504. <code>
  505. <!element p o o ( %inline | %sectpar )+ >
  506. <!entity ptag '<p>' >
  507. <!entity psplit '&etago;p><p>' >
  508.  
  509. <!shortref pmap
  510.     "&ero;#RS;B" null
  511.     "&ero;#RS;B&ero;#RE;" psplit
  512.     "&ero;#RS;&ero;#RE;" psplit
  513.     '"' qtag 
  514.           "[" ftag
  515.           "~" nbsp
  516.           "_" lowbar
  517.           "#" num
  518.           "%" percnt
  519.           "^" circ
  520.           "{" lcub
  521.           "}" rcub
  522.           "|" verbar >
  523.  
  524. <!usemap pmap p>
  525. </code>
  526.  
  527. Sentences or phrases within paragraphs can be emphasized in a number
  528. of ways.  The <tt>em</> tag is used to choose the default form of
  529. emphasis, which is usually <em>italic</> type, but depends on the
  530. style of the background text.  If the background text is formatted in
  531. italics type, as it usually is in definitions, for example, than
  532. emphasized text will be formatted using a plain, roman typeface.
  533. However, various forms of emphasis can be explicitly chosen.  These
  534. include: <bf>bold face</> (<tt>bf</>), <it>italics</> (<tt>it</>),
  535. <sf>sans serif</> (<tt>sf</>), <sl>slanted</> (<tt>sl</>), and
  536. <tt>typewriter</> (<tt>tt</>) styles.
  537.  
  538. <code>
  539. <!element em - - (%inline)>
  540. <!element bf - - (%inline)>
  541. <!element it - - (%inline)>
  542. <!element sf - - (%inline)>
  543. <!element sl - - (%inline)>
  544. <!element tt - - (%inline)>
  545. </code>
  546.  
  547. The <tt>tt</> element simulates a "typewriter".  That is, with a
  548. couple of exceptions, characters are printed exactly as they appear on
  549. the display.  This is useful for including small segments of computer
  550. code within paragraphs.  See the section on literate programming for
  551. more information, <ref id="litprog">.
  552.  
  553. Sentences within paragraphs can be quoted using the <em>short
  554. quote</>, (<tt>sq</>) tag, as in <tt><sq>The rain in Spain falls
  555. mainly on the plain.</></tt>, but this is usually not necessary.  In
  556. most contexts where one will want to use quotations, there is a map
  557. allowing the &dquot symbol to be used as a short reference for both
  558. the starting and ending <tt>sq</> tags.  So one can just type:
  559. <tt>"The rain in Spain falls mainly on the plain."</>
  560.  
  561. Quotations extending over a number of paragraphs are marked using the
  562. <em>long quote</> (<tt>lq</>) element.  Long quotes are formatted in
  563. &LaTeX by indenting the left and right margins.  For example, <ncite
  564. id="Lamport86" note="pp. xiii">:
  565.  
  566. <lq>
  567. <p>The &LaTeX document preparation system is a special version of
  568. Donald Knuth's &TeX program.  &TeX is a sophisticated program designed
  569. to produce high-quality typesetting, especially for mathematical text.
  570. &hellip
  571.  
  572. &LaTeX represents a balance between functionality and ease of use.
  573. Since I implemented most of it myself, there was also a continual
  574. compromise between what I wanted to do and what I could do in a
  575. reasonable amount of time.  &hellip 
  576. </lq>
  577.  
  578. <code>
  579. <!element sq - - (%inline)>
  580.  
  581. <!entity   ftag     '<f>'    -- formula begin -- >
  582. <!entity   qendtag  '&et;sq>'>
  583.  
  584. <!shortref sqmap 
  585.       "&ero;#RS;B" null
  586.       '"' qendtag 
  587.       "[" ftag
  588.       "~" nbsp
  589.       "_" lowbar
  590.       "#" num
  591.       "%" percnt
  592.       "^" circ
  593.       "{" lcub
  594.       "}" rcub
  595.       "|" verbar >
  596.  
  597. <!usemap   sqmap    sq >
  598.  
  599. <!element lq - - (p*)>
  600. </code>
  601.  
  602. <sect1>Lists
  603.  
  604. <p>
  605. Four types of lists are supported, which differ according to the
  606. type of label used to mark each item in the list.  Use <tt>itemize</>
  607. to create a list in which each item is marked with some symbol such as
  608. a dash or bullet. The <tt>enum</> tag is used to create an
  609. enumeration, i.e. a list in which each item is labelled with a number
  610. (or letter) indicating its rank or position in the list.  The
  611. <tt/list/ type of list does not label the items at all.  Finally, use
  612. <tt>descrip</> to create a list in which each item is labelled by some
  613. tag of your own choice. Lists of various types can nested.  For
  614. example:
  615.  
  616. <verb>
  617. <itemize>
  618. <item>
  619. A level one item.
  620. <item> Here's level two:
  621.     <enum>
  622.     <item> A level two item.
  623.     <item> Here's level three:
  624.         <enum>
  625.         <item> A level three item.
  626.         <item>Here's level four:
  627.               <descrip>
  628.                   <tag/Red./  Is the color of my true love's hair.
  629.                       <tag/Blue./  Is a property of some movies.
  630.                       <tag/Yellow./  Characterizes some forms of journalism.
  631.                       &et;descrip>
  632.         <item>A last level three item
  633.         &et;enum>
  634.     <item>A last level two item
  635.     &et;enum>
  636. <item>A last level one item.
  637. &et;itemize>
  638. </verb>
  639.  
  640. This is formatted by &LaTeX; as:
  641.  
  642. <itemize>
  643. <item>
  644. A level one item.
  645. <item> Here's level two:
  646.     <enum>
  647.     <item> A level two item.
  648.     <item> Here's level three:
  649.         <enum>
  650.         <item> A level three item.
  651.         <item>Here's level four:
  652.               <descrip>
  653.                   <tag/Red./  Is the color of my true love's hair.
  654.                       <tag/Blue./  Is a property of some movies.
  655.                       <tag/Yellow./  Characterizes some forms of journalism.
  656.                       </descrip>
  657.         <item>A last level three item
  658.         </enum>
  659.     <item>A last level two item
  660.     </enum>
  661. <item>A last level one item.
  662. </itemize>
  663.  
  664. <code>
  665. <!element itemize - - (item+)>
  666. <!element list - - (item+)>
  667. <!element enum - - (item+)>
  668. <!element descrip - - ((tag?, (%inline; | %sectpar;)*, p*)+) >
  669. <!element item o o ((%inline; | %sectpar;)*, p*) >
  670. <!element tag - o (%inline)>
  671. <!usemap global (list,itemize,enum,descrip)>
  672. </code>
  673.  
  674. For reasons having to do with our translation into &LaTeX, line feeds
  675. within <tt>tag</> elements are translated into spaces, using the
  676. <tt>oneline</> short reference map:
  677.  
  678. <!--
  679. <!shortref bodymap
  680.      "&ero;#RS;B&ero;#RE;" ptag
  681.      "&ero;#RS;&ero;#RE;" ptag
  682.       '"' qtag 
  683.       "[" ftag
  684.       "~" nbsp
  685.       "_" lowbar
  686.       "#" num
  687.       "%" percnt
  688.       "^" circ
  689.       "{" lcub
  690.       "}" rcub
  691.       "|" verbar>
  692. -->
  693.  
  694. <code>
  695. <!entity space " ">
  696. <!entity null "">
  697. <!shortref oneline
  698.      "&ero;#RS;&ero;#RE;" null
  699.      "&ero;#RS;B&ero;#RE;" null
  700.       '"' qtag 
  701.       "[" ftag
  702.       "~" nbsp
  703.       "_" lowbar
  704.       "#" num
  705.       "%" percnt
  706.       "^" circ
  707.       "{" lcub
  708.       "}" rcub
  709.       "|" verbar>
  710. <!usemap oneline tag>
  711. </code>
  712.  
  713. <sect1>Figures and Tables</>
  714.  
  715. <p>Figures and tables are floating elements; they may appear at a
  716. different location in the printed version of the document than in the
  717. input file.   There is a location (<tt/loc/) attribute, which can be
  718. used to influence the location chosen by the formatter.  The value of
  719. the <tt/loc/ attribute is a string of up to four letters, where each
  720. letter declares a location at which the figure or table may appear, as
  721. follows:
  722. <descrip>
  723. <tag/<tt/h/./ At the same relative location as it appears in the SGML
  724. input file (i.e. <em/here/).
  725. <tag/<tt/t/./ At the <em/top/ of a page.
  726. <tag/<tt/b/./ At the <em/bottom/ of a page.
  727. <tag/<tt/p/./ On a separate <em/page/ containing only figures and tables.
  728. </descrip>
  729. The default value of the <tt/loc/ attribute is <tt/tbp/.
  730.  
  731. A <tt>figure</> is a graphic combined with an optional caption.  Two
  732. types of figures are currently supported.  The first, and easiest, is
  733. to use the <tt>eps</> tag to include an Encapsulated PostScript file
  734. in the document.  Encapsulated PostScript files are centered
  735. horizontally on the page.  The size of the graphic is its "natural"
  736. size; i.e. the size it would have if printed directly on a PostScript
  737. printer.  You need only know the name of the file containing the
  738. graphic.
  739.  
  740. Encapsulated PostScript graphics can be created using a variety of
  741. different editors.  If you are using Unix with an X11-based graphical
  742. user-interface, you may want to try <tt>idraw</>, which stores its
  743. documents directly as Encapsulated PostScript files. Other interesting
  744. X11-based drawing program are <tt/xfig/ and <tt/tgif/.
  745.  
  746. For example, to include the graphic contained in an Encapsulated
  747. PostScript file named <tt>issues.ps</>, you would type:
  748.  
  749. <verb>
  750. <figure>
  751.         <eps file="issues">
  752.         <caption>An <tt>idraw&et;> Drawing &et;>
  753. &et;figure>
  754. </verb>
  755.  
  756. Which would then appear as in figure <ref id="issues">.
  757.  
  758. <figure>
  759.         <eps file="issues">
  760.         <caption><label id="issues">An <tt>idraw</> Drawing </>
  761. </figure>
  762.  
  763. Notice that the ".ps" extension is <em>not</> to be included in the
  764. file attribute of the <tt>eps</> element, but that the actual file
  765. must include the ".ps" extension.
  766.  
  767. The second possibility is to use the <em/placeholder/ (<tt>ph</>)
  768. tag to leave space in which to later paste the graphic, in the old,
  769. reliable manner.  For example, to leave 10 cm space for
  770. some graphic, type:
  771.  
  772. <verb>
  773. <figure>
  774.         <ph vspace="10cm">
  775. &et;figure>
  776. </verb>
  777.  
  778. Be sure not to leave a space between the number and the unit of
  779. measurement used, which may be <tt>cm</>, <tt>mm</> or <tt>in</>.
  780.  
  781. <code>
  782. <!element figure - - ((eps | ph ), caption?)>
  783. <!attlist figure 
  784.     loc cdata "tbp">
  785.  
  786. <!element eps - o empty  >
  787. <!attlist eps
  788.         file cdata #required>
  789. <!element ph - o empty >
  790. <!attlist ph
  791.         vspace cdata #required>
  792.  
  793. <!element caption - o (%inline)>
  794.  
  795. <!usemap oneline caption>
  796. </code>
  797.  
  798. Next, there is a <tt>tabular</> element.  Using &LaTeX;, tabulars
  799. must be small enough to fit on a single page.  The current
  800. <tt>tabular</> element has been kept quite simple.  It certainly does
  801. not (yet) offer all the flexibility of &LaTeX;.  However, it may well
  802. be that it is sufficient for most users.  More complex tables can,
  803. depending on your choice of formatters, be created using &LaTeX or
  804. Unix's <tt/tbl/ program, with the <tt>x</> element, or with any
  805. program capable of generating Encapsulated PostScript, which can then
  806. be included using an <tt>eps</> element.
  807.  
  808. A <tt>tabular</> consists of a number of rows, separated by the
  809. <tt>rowsep</> element, each of which consists of a number of columns
  810. separated by the <tt>colsep</> element.
  811.  
  812. The format of the tabular is controlled by the <em>column
  813. alignment</> (<tt>ca</>) attribute.  For each column in the tabular
  814. there is a letter in the <tt>ca</> attribute: 1) <tt>c</> for
  815. centered; 2) <tt>l</> for flush left; or 3) <tt>r</> for flush right.
  816. In addition, &verbar can be used to insert vertical lines running the
  817. complete height of the table.  This will be made clear in the example
  818. which is coming shortly.
  819.  
  820. First, however, let me describe the short reference map defined for
  821. tabulars.  Rather than typing <tt><colsep></> and
  822. <tt><rowsep></> explicitly, one can just type &verbar to separate
  823. columns, and &commat to separate rows.  Also, within tabulars, &lsqb
  824. can be used to start a mathematical formula, and &dquot starts short
  825. quotes as usual.  (The other short references just hide any special
  826. meaning the character may have to &TeX;.)
  827.  
  828. <code>
  829. <!entity % tabrow "(%inline, (colsep, %inline)*)" >
  830. <!element tabular - - 
  831.     (%tabrow, (rowsep, hline?, %tabrow)*, caption?) >
  832.  
  833. <!attlist tabular
  834.     ca cdata #required>
  835.  
  836. <!element rowsep - o empty>
  837. <!element colsep - o empty>
  838. <!element hline  - o empty>
  839.  
  840. <!entity rowsep "<rowsep>">
  841. <!entity colsep "<colsep>">
  842.  
  843. <!shortref tabmap
  844.      "&ero;#RE;" null
  845.      "&ero;#RS;&ero;#RE;" null
  846.      "&ero;#RS;B&ero;#RE;" null
  847.      "&ero;#RS;B" null
  848.       "B&ero;#RE;" null
  849.       "BB"  null
  850.       "&ero;#SPACE;" null
  851.       "&ero;#TAB;" null
  852.       "@" rowsep
  853.       "|" colsep 
  854.       "[" ftag
  855.       '"' qtag
  856.       "_" thinsp
  857.       "~" nbsp
  858.       "#" num
  859.       "%" percnt
  860.       "^" circ
  861.       "{" lcub
  862.       "}" rcub >
  863.  
  864. <!usemap  tabmap tabular>
  865. </code>
  866.  
  867. The <tt>hline</> element can be use to draw a horizontal line along
  868. the length of the table, to separate rows.
  869.  
  870. A <tt/table/ element consists of a <tt>tabular</> followed by an
  871. optional <tt>caption</>.  Unlikes tabulars, A <tt/table/ is a floating
  872. "body", like a figure.  It may be moved to another (near) location
  873. within the formatted document.  A <tt/tabular/, however, appears at
  874. the same place in the formatted document as in the SGML source file.
  875.  
  876. <code>
  877. <!element table   - - (tabular, caption?) >
  878. <!attlist table
  879.     loc cdata "tbp">
  880. </code>
  881.  
  882. Here is how table <ref id="GPC">   was typed:
  883.  
  884. <verb>
  885. <table>
  886. <tabular ca="ll|ll">
  887. ae   |       &ero;ae   | Ae   |   &ero;Ae       @
  888. oe   |       &ero;oe   | Oe   |   &ero;Oe       @
  889. ue   |       &ero;ue   | Ue   |   &ero;Ue       @
  890. sz   |       &ero;sz   | amp  |   &ero;amp      @
  891. bsol |       &ero;bsol | circ |   &ero;circ     @
  892.      .
  893.      .
  894.      .
  895. Dagger |       &ero;Dagger | sect  |  &ero;sect     @
  896. para   |       &ero;para   | copy  |  &ero;copy     @
  897. mdash  |       &ero;mdash  | tilde |  &ero;tilde    
  898. &et;tabular>
  899. <caption><label id="GPC">
  900.     General Purpose Characters
  901. &et;caption>
  902. &et;table>
  903. </verb>
  904.  
  905.  
  906. <sect1><heading><label id="litprog">Literate Programming</>
  907.  
  908. <p>
  909. The original motivation behind the development of these document
  910. types was to create an environment for literate programming in an
  911. arbitrary programming language similar to Donald Knuth's WEB system
  912. for literate programming in Pascal <cite id="Knuth84">.  The basic
  913. idea is to include the source code of a program inside of its
  914. documentation, instead of the other way around: including comments
  915. within the source code.
  916.  
  917. The features offered here to support literate programming, or merely
  918. the documentation of existing programs, have been kept to a minimum.
  919. Snippets of code can be mentioned within sentences using the <tt>tt</>
  920. tag.  These are formatted using a <tt>typewriter</> font suitable for
  921. program code, but the spacing and indentation of the code is not
  922. retained.  Within <tt/tt/ elements, the only characters which may not
  923. be literally interpreted are &dollar, &bsol, &, and <tt></</>.
  924. For the &dollar and &bsol symbols, always use the <tt>dollar</> and
  925. <tt>bsol</> entities.  For the & and < symbols, use the
  926. <tt>amp</> and <tt>lt</> entities if the string in which they occur
  927. could be mistaken for an entity reference, an element start tag or an
  928. element end tag.
  929.  
  930. To include larger segments of code, retaining its line breaks,
  931. tabulation and spacing, use the <tt>code</> tag or the <tt>verb</>
  932. tag.  Within these tags just about all characters are interpreted
  933. literally.  The exceptions are:
  934.  
  935. <enum>
  936.         <item>As SGML entities may be used within <tt>verb</> and
  937. <tt>code</> elements, use the <tt>ero</> entity to represent the &
  938. symbol in strings which might otherwise be mistaken for entity
  939. references.  (Notice that the <tt>amp</> entity is not used to represent &
  940. in this context.) 
  941.         <item> As there must be some way of ending such elements,
  942. use the <tt>etago</> entity to represent  <tt>&et</> in strings
  943. which might otherwise be interpreted as end tags.  (Do not use the
  944. <tt>lt</> entity for this purpose here.)  Start tags can be typed
  945. literally in this context, without using entities.
  946.         <item>Unfortunately &TeX peeks through a bit here
  947. as well; The string <tt>\end{verbatim}</> may not occur within
  948. <tt>code</> or <tt>verb</> elements.  Presumably this will not often
  949. be a problem.  
  950. </enum>
  951.  
  952. For example, to include the "hello world" C program in a document,
  953. just type:
  954.  
  955. <verb>
  956. <code>
  957. main ()
  958. {
  959.         /* This is the famous hello world program */
  960.  
  961.         printf("hello world\n");
  962. }
  963. &et;code>
  964. </verb>
  965.  
  966. When formatted, spaces and line breaks are preserved:
  967.  
  968. <verb>
  969. main ()
  970. {
  971.         /* This is the famous hello world program */
  972.  
  973.         printf("hello world\n");
  974. }
  975. </verb>
  976.  
  977. Notice that no entities where required in this code.
  978. With few exceptions, it should be possible to just wrap <tt>verb</> or
  979. <tt>code</> tags around existing pieces of code without change.
  980.  
  981. The idea of literate programming is that the documentation
  982. <em>is</> the program, so there must be some way of extracting the
  983. source code from the SGML document.  Just how to do this is described
  984. in chapter <ref id="UC">, below.
  985.  
  986.  The user must have a means of indicating which pieces of code are
  987. to be included in the source code, and in which order.  Our solution
  988. to this problem is very simple: <em>Only <tt>code</> elements are to
  989. be extracted, and they are extracted in the same order as they appear
  990. in the document.</> That is, <tt>verb</> elements are <em>not</>
  991. extracted, and may be used, e.g., for examples or draft versions of
  992. the code included for explanatory or tutorial purposes. 
  993.  
  994.  <tt>code</> and <tt>verb</> elements may be formatted differently.
  995. Using our translation into &LaTeX, for example, <tt>code</> elements
  996. are distinguished by being bracketed by lines the width of the page.
  997.  
  998. <code>
  999. <!element code - - rcdata>
  1000. <!element verb - - rcdata>
  1001.  
  1002. <!shortref ttmap
  1003.     "&ero;#RS;B" null
  1004.         '#'     num
  1005.         '%'     percnt
  1006.         '~'     tilde
  1007.         '_'     lowbar
  1008.         '^'     circ
  1009.         '{'     lcub
  1010.         '}'     rcub
  1011.         '|'     verbar >
  1012.  
  1013. <!usemap ttmap  tt>
  1014. </code>
  1015.  
  1016. <sect1><heading><label id="math">Mathematical Formulas</>
  1017.  
  1018. <p>
  1019. The <tt>qwertz</> document types include elements for describing
  1020. mathematical formulas completely within SGML, similar to the system
  1021. described in <cite id="daphne89">.  To start, there are a fairly large
  1022. number of entities for mathematical symbols. (The set of entities
  1023. chosen are for the symbols available in both &TeX and in the
  1024. PostScript Symbol font.)  Although this may be a minor irritation for
  1025. seasoned &TeX users, we have decided to follow the naming conventions
  1026. for mathematical symbols adopted in the SGML Standard  <cite
  1027. id="Smith88">. The complete set of mathematical symbols currently
  1028. defined, including the Greek alphabet are listed in 
  1029. tables <ref id="mathsym">  and <ref id="greek">, in alphabetical
  1030. order.
  1031.  
  1032. <code>
  1033. <!entity % math system -- math symbols -- >
  1034. %math;
  1035. </code>
  1036.  
  1037. <table>
  1038. <tabular ca="ll|ll|ll|ll">
  1039. Prime   | [&Prime]      |  
  1040. aleph   | [&aleph]      |
  1041. and     | [&and]        | 
  1042. ang    | [&ang]    @  
  1043. ap      | [&ap]            |  
  1044. arr     | [&darr]       |
  1045. bottom  | [&bottom]     |
  1046. bull    | [&bull]       @  
  1047. cap     | [&cap]        | 
  1048. cir     | [&cir]        |
  1049. clubs    | [&clubs]    |
  1050. congr    | [&congr]      @
  1051. cup     | [&cup]        |  
  1052. diams    | [&diams]    |
  1053. divide    | [÷]     |  
  1054. dot     | [&dot]        @
  1055. empty   | [&empty]      |  
  1056. equiv   | [&equiv]      |  
  1057. exist   | [&exist]      |  
  1058. forall  | [&forall]     @
  1059. ge      | [&ge]         |
  1060. hArr    | [&hArr]       |  
  1061. harr    | [&harr]       |
  1062. hearts    | [&hearts]    @  
  1063. image   | [&image]      |
  1064. infin   | [&infin]      |  
  1065. isin    | [&isin]       |  
  1066. lArr    | [&lArr]       @
  1067. lang    | [&lang]       | 
  1068. larr    | [&larr]       |      
  1069. le      | [&le]         |
  1070. mid     | [&mid]        @
  1071. minus   | [&minus]      |  
  1072. nabla    | [&nabla]    |  
  1073. ne      | [&ne]         |
  1074. nequiv  | [&nequiv]     @  
  1075. not     | [¬]    |  
  1076. notin   | [¬in]      |
  1077. nsub    | [&nsub]       |  
  1078. nsube   | [&nsube]      @
  1079. nsup    | [&nsup]       |  
  1080. nsupe   | [&nsupe]      | 
  1081. nvDash  | [&nvDash]     |
  1082. nvdash  | [&nvdash]     @  
  1083. oplus   | [&oplus]      | 
  1084. or      | [&or]         |
  1085. otimes  | [&otimes]     |  
  1086. part    | [&part]    @
  1087. plusmn  | [±]     |  
  1088. prime   | [&prime]      |
  1089. prop    | [&prop]       |  
  1090. rArr    | [&rArr]       @  
  1091. rang    | [&rang]       |
  1092. rarr    | [&rarr]       |
  1093. real    | [&real]       |  
  1094. setmn   | [&setmn]      @  
  1095. spades     | [&spades]    |
  1096. square  | [&square]     |  
  1097. sub     | [&sub]        |  
  1098. sube    | [&sube]       @
  1099. sup     | [&sup]        |  
  1100. supe    | [&supe]       |
  1101. times   | [×]      |  
  1102. uArr    | [&uArr]       @
  1103. uarr    | [&uarr]       |  
  1104. vDash   | [&vDash]      |
  1105. vdash   | [&vdash]      @  
  1106. </tabular>
  1107. <caption><label id="mathsym">Math Symbols</>
  1108. </table>
  1109.  
  1110. <table>
  1111. <tabular ca="ll|ll|ll">
  1112.         alpha   | [&alpha]      |
  1113.         beta    | [&beta]       | 
  1114.         gamma   | [&gamma]      @
  1115.         Gamma   | [&Gamma]      |
  1116.         delta   | [&delta]      |
  1117.         Delta   | [&Delta]      @
  1118.         epsi    | [&epsi]       |
  1119.         zeta    | [&zeta]       |
  1120.         eta     | [&eta]        @
  1121.         thetas  | [&thetas]     |
  1122.         Theta   | [&Theta]      |
  1123.         iota    | [&iota]       @
  1124.         kappa   | [&kappa]      |
  1125.         lambda  | [&lambda]     |
  1126.         mu      | [&mu]         @
  1127.         nu      | [&nu]         |
  1128.         xi      | [&xi]         |
  1129.         Xi      | [&Xi]         @
  1130.         pi      | [&pi]         |
  1131.         Pi      | [&Pi]         |
  1132.         rho     | [&rho]        @
  1133.         sigma   | [&sigma]      |
  1134.         sigmav  | [&sigmav]     |
  1135.         Sigma   | [&Sigma]      @
  1136.         tau     | [&tau]        |
  1137.         upsi    | [&upsi]       |
  1138.         Upsi    | [&Upsi]       @ 
  1139.         phis    | [&phis]       |
  1140.         Phi     | [&Phi]        |
  1141.         chi     | [&chi]        @
  1142.         psi     | [&psi]        |
  1143.         Psi     | [&Psi]        |
  1144.         omega   | [&omega]      @
  1145.         Omega   | [&Omega]       
  1146. </tabular>
  1147. <caption><label id="greek">Greek Letters</>
  1148. </table>
  1149.  
  1150.  &TeX symbols not in table 2 may nonetheless be generated, by
  1151. defining an entity using the <tt>mc</> element.  For example, to print
  1152. the <x>$\leadsto$</x> symbol, you could first define an entity,
  1153. perhaps using the name adopted for this symbol in the SGML standard:
  1154.  
  1155. <verb>
  1156. <!entity rarrw "<mc/<x/\leadsto//">
  1157. </verb>
  1158.  
  1159. Of course, this approach is &TeX dependent.  But this dependency is
  1160. clearly noted at the beginning of the document, and it would be an
  1161. easy matter to replace the &TeX command for such entities with the
  1162. appropriate commands for some other formatter.
  1163.  
  1164. The <tt>mc</> tag used in this entity definition is for <em>math
  1165. characters</>.  The entity could have been defined using only the <tt>x</>
  1166. tag described in section <ref id="misc">, but it is "safer" to use the
  1167. <tt>mc</> tag when defining entities which are only to be used within
  1168. formulas, as the SGML parser will complain if they are used elsewhere.
  1169. If <tt>x</> were used instead, such errors would first be caught by
  1170. &TeX;.
  1171.  
  1172. <code>
  1173. <!element  mc  - - cdata >
  1174. </code>
  1175.  
  1176. There are a number of parameters for formulas.  These will most
  1177. likely be of little interest to most users, but are stated here for
  1178. the sake of completeness.
  1179.  
  1180. <code>
  1181. <!entity % sppos     "tu" >
  1182. <!entity % fcs       "%sppos;|phr" >
  1183. <!entity % fcstxt    "#pcdata|mc|%fcs;" >
  1184. <!entity % fscs      "rf|v|fi" >
  1185. <!entity % limits    "pr|in|sum" >
  1186. <!entity % fbu       "fr|lim|ar|root" >
  1187. <!entity % fph       "unl|ovl|sup|inf" >
  1188. <!entity % fbutxt    "(%fbu;) | (%limits;) | 
  1189.                       (%fcstxt;)|(%fscs;)|(%fph;)" >
  1190. <!entity % fphtxt    "p|#pcdata" >
  1191. </code>
  1192.  
  1193.  There are three elements for representing formulas: <tt>f</>, for
  1194. ordinary short formulas appearing "in-line"; <tt>dm</> for
  1195. <em>displayed formulas</> to be centered on a line (or lines) by
  1196. themselves; and <tt>eq</> for displayed formulas which are to be
  1197. numbered sequentially throughout the document (i.e. so-called
  1198. "equations").
  1199.  
  1200. <code>
  1201. <!element  f        - - ((%fbutxt;)*) -(footnote) >
  1202.  
  1203. <!entity   fendtag  '&et;f>'   -- formula end -- >
  1204.  
  1205. <!shortref fmap 
  1206.       "&ero;#RS;B" null
  1207.       "&ero;#RS;B&ero;#RE;" null
  1208.       "&ero;#RS;&ero;#RE;" null
  1209.       "_" thinsp
  1210.       "~" nbsp
  1211.       "]" fendtag
  1212.       "#" num
  1213.       "%" percnt
  1214.       "^" circ
  1215.       "{" lcub
  1216.       "}" rcub
  1217.       "|" verbar>
  1218.  
  1219. <!usemap   fmap     f >
  1220.  
  1221. <!element  dm       - - ((%fbutxt;)*) -(footnote)>
  1222. <!element  eq       - - ((%fbutxt;)*) -(footnote)>
  1223.  
  1224. <!shortref dmmap
  1225.      "&ero;#RE;" space
  1226.       "_" thinsp
  1227.       "~" nbsp
  1228.       "]" fendtag
  1229.       "#" num
  1230.       "%" percnt
  1231.       "^" circ
  1232.       "{" lcub
  1233.       "}" rcub
  1234.       "|" verbar>
  1235.  
  1236. <!usemap dmmap (dm,eq)>
  1237. </code>
  1238.  
  1239. Usually it is not necessary to type the starting and ending tags of
  1240. the <tt>f</> element explicitly: &lsqb and &rsqb are short
  1241. reference delimiters, allowing one to simply type, for example,
  1242. <tt>[&alpha &rarr &beta]</>, instead of
  1243. <tt><f>&alpha &rarr &beta</f></tt> to represent
  1244. [&alpha &rarr &beta].<footnote>&TeX users will appreciate that this
  1245. notation is no more verbous than &TeX;.</footnote>
  1246.  
  1247. The only characters of interest in <tt>fmap</> are &lowbar &tilde
  1248. and ].  &lowbar is a short reference for <tt>thinsp</>, which adds a
  1249. little extra horiztonal space.  &tilde means <tt>nbsp</>, which in
  1250. turn denotes a non-breaking space.  &TeX will not start a new line at
  1251. a <tt>nbsp</>.  Finally, ] is used to end the formula.  The other
  1252. characters in this map just protect us from any special meaning &TeX
  1253. gives them.
  1254.  
  1255.  The <tt>dmmap</> is much the same as the <tt>fmap</>.  There are
  1256. just two differences:  1) ] is not a short reference for the <tt>f</>
  1257. closing tag (and instead has its literal meaning), and 2) carriage
  1258. returns and new lines are replaced by spaces, for reasons having to do
  1259. with the way &TeX formats formulas.   Use the <tt>tu</> element,
  1260. defined a bit later, to force line breaks in formulas.
  1261.  
  1262. Of course, formulas consist of more than just a string of math
  1263. symbols.  There are elements for representing fractions (<tt>fr</>),
  1264. products (<tt>pr</>), integrals (<tt>in</>), sums (<tt>sum</>), roots
  1265. (<tt>root</>) and arrays (<tt>ar</>).  Each of these will be described
  1266. next.
  1267.  
  1268. A fraction consists of a numerator (<tt>nu</>) and a denominator
  1269. (<tt>de</>).   For example, [12/37] can be written as:
  1270.  
  1271. <verb>
  1272. [<fr><nu>12<de>37&et;fr>]
  1273. </verb>
  1274.  
  1275. Of course, this is rather lengthy.  For simple fractions such as
  1276. this, you may prefer to just type <tt>[12/37]</>, which is
  1277. formatted by &LaTeX in the same way.<footnote>On the other hand, if
  1278. you are a SGML purist, you may prefer not to do this, as it makes
  1279. assumptions about the formatting system being used.</footnote>
  1280.  
  1281. <code>
  1282. <!element  fr       - - (nu,de) >
  1283. <!element  nu       o o ((%fbutxt;)*) >
  1284. <!element  de       o o ((%fbutxt;)*) >
  1285. </code>
  1286.  
  1287. Products, integrals and sums all have similiar structure,
  1288. consisting of a <em>lower limit</> (<tt>ll</>), an <em>upper limit</>
  1289. (<tt>ul</>) and an optional <em>operand</> (<tt>opd</>).
  1290.  
  1291. <code>
  1292. <!element  ll       o o ((%fbutxt;)*) >
  1293. <!element  ul       o o ((%fbutxt;)*) >
  1294. <!element  opd      - o ((%fbutxt;)*) >
  1295. <!element  pr       - - (ll,ul,opd?) >
  1296. <!element  in       - - (ll,ul,opd?) >
  1297. <!element  sum      - - (ll,ul,opd?) >
  1298. </code>
  1299.  
  1300. So, for example, 
  1301.  
  1302. <dm>
  1303.         <sum><ll>i=1<ul>n<opd>x<inf>i</></sum> =
  1304.         <in><ll>0<ul>1<opd>f</in>
  1305. </dm>
  1306. was typed as:
  1307. <verb>
  1308. <dm>
  1309.         <sum><ll>i=1<ul>n<opd>x<inf>i&et>&et;sum> =
  1310.         <in><ll>0<ul>1<opd>f&et;in>
  1311. &et;dm>
  1312. </verb>
  1313.  
  1314. This example also shows how to represent subscripts, using the
  1315. <tt>inf</> tag.  There is also a <tt>sup</> tag for superscripts.
  1316.  
  1317.  
  1318. For operators with upper and lower limits other than products, sums
  1319. or integrals, use the <tt>lim</> element.
  1320.  
  1321. <code>
  1322. <!element  lim      - - (op,ll,ul,opd?) >
  1323. <!element  op       o o (%fcstxt;|rf|%fph;) -(tu) >
  1324. </code>
  1325.  
  1326. For example,
  1327. <dm>
  1328.         <lim><op>&bigcup<ll>i=0<ul>n<opd>{&alpha<inf>i</> &rarr &beta}</lim>
  1329. </dm>
  1330. was typed as
  1331. <verb>
  1332. <!entity bigcup "<mc>\bigcup&et;>">  
  1333. ...
  1334. <dm>
  1335.         <lim>&ero;bigcup<ll>i=0<ul>n&et;>
  1336.              <opd>{&ero;alpha<inf>i&et;> &ero;rarr &ero;beta}&et>
  1337.         &et;lim>
  1338. &et;dm>
  1339. </verb>
  1340. Notice that it isn't necessary to type the <tt>op</> tag here.
  1341.  
  1342. Roots can be represented using the, what else, <tt>root</> element.
  1343. By default, <tt>root</> produces square roots.  The <tt>n</> attribute
  1344. of <tt>root</> can be used for other roots.  For example, type
  1345. <tt>[<root n=3/x+y/]</tt> to get [<root n=3/x+y/].
  1346.  
  1347. <code>
  1348. <!element  root     - - ((%fbutxt;)*) >
  1349. <!attlist  root
  1350.         n cdata "">
  1351. </code>
  1352.  
  1353. Arrays, or matrices, consist of a sequence of rows, each of which
  1354. contains a sequence of columns.   Every row in the array must contain
  1355. the same number of columns.   Rows are <em>separated</> by the
  1356. <tt>arr</> tag; columns by the <tt>arc</> tag.  The array itself is
  1357. delimited by the <tt>ar</> tag.   
  1358.  
  1359. <code>
  1360. <!element col o o ((%fbutxt;)*) >
  1361. <!element row o o (col, (arc, col)*) >
  1362.  
  1363. <!element  ar       - - (row, (arr, row)*) >
  1364. <!attlist  ar
  1365.     ca     cdata    #required >
  1366. <!element  arr      - o empty >
  1367. <!element  arc      - o empty >
  1368. </code>
  1369.  
  1370. This is a place where an SGML short reference map has proven
  1371. useful:
  1372.  
  1373. <code>
  1374. <!entity   arr "<arr>" >
  1375. <!entity   arc "<arc>" >
  1376.  
  1377. <!shortref arrmap
  1378.      "&ero;#RE;" space
  1379.       "@" arr
  1380.       "|" arc 
  1381.       "_" thinsp
  1382.       "~" nbsp
  1383.       "#" num
  1384.       "%" percnt
  1385.       "^" circ
  1386.       "{" lcub
  1387.       "}" rcub >
  1388.  
  1389. <!usemap   arrmap   ar >
  1390. </code>
  1391.  
  1392.  Columns can be separated using the &verbar character; rows
  1393. with the &commat character.   
  1394.  
  1395.  For example, this matrix
  1396. <dm>
  1397. <ar ca=clcr>
  1398. a+b+c   |       uv      |       x-y     |       27      @
  1399. a+b     |       u+v     |       z       |       134     @
  1400. a       |       3u+vw   |       xyz     |       2,978   
  1401. </ar>
  1402. </dm>
  1403. was typed as:
  1404. <verb>
  1405. <ar ca=clcr>
  1406. a+b+c  |  uv     |  x-y  |  27     @
  1407. a+b    |  u+v    |  z    |  134    @
  1408. a      |  3u+vw  |  xyz  |  2,978   
  1409. &et;ar>
  1410. </verb>
  1411.  
  1412. The <em>column alignment</> of an array must be specified using the
  1413. <tt>ca</> attribute, as shown in the example.  For each column in the
  1414. array, there is a letter in the <tt>ca</> attribute.  There are three
  1415. alternatives:  1) <tt>c</> for centered; 2) <tt>l</> for flush left;
  1416. and 3) <tt>r</> for flush right. 
  1417.  
  1418. There remain a few miscellaneous math elements to describe.
  1419. <tt>sup</> and <tt>inf</>, for superscripts and subscripts, were
  1420. mentioned above.  <tt>unl</> and <tt>ovl</> can be used to
  1421. <em>underline</> or <em>overline</> formulas.  <tt>rf</> is used for
  1422. identifiers, such as function names (e.g. <tt>cos</> or <tt>sin</>)
  1423. within formulas.  Similarly, <tt>phr</> is used to delimit phrases of
  1424. ordinary text within formulas.  (Both of these are necessary, as
  1425. strings of characters within formulas denote sequences of variables,
  1426. not words.)  The <tt>v</> tag can be used to denote a <em>vector</>,
  1427. as in [<v>x</>].  Calligraphic characters, such as [<fi>L</>], can be
  1428. denoted using the <tt>fi</> tag.  Finally, line breaks can be inserted
  1429. into formulas using the <tt>tu</> element.
  1430.  
  1431. <code>
  1432. <!element  sup      - - ((%fbutxt;)*) -(tu) >
  1433. <!element  inf      - - ((%fbutxt;)*) -(tu) >
  1434. <!element  unl - - ((%fbutxt;)*) >
  1435. <!element  ovl - - ((%fbutxt;)*) >
  1436. <!element  rf  - o (#pcdata) >
  1437. <!element  phr - o ((%fphtxt;)*) >
  1438. <!element  v   - o ((%fcstxt;)*) 
  1439.     -(tu|%limits;|%fbu;|%fph;) >
  1440. <!element  fi  - o (#pcdata) >
  1441. <!element  tu  - o empty >
  1442.  
  1443. <!usemap global (rf,phr)>
  1444. </code>
  1445.  
  1446. <sect1>Definitions, Lemmas and Theorems</>
  1447.  
  1448. <p>
  1449. There are a number of elements useful for representing
  1450. <em>definitions</> (<tt>def</>), <em>propositions</> (<tt>prop</>),
  1451. <em>lemmas</> (<tt>lemma</>), <em>corollaries</> (<tt>coroll</>),
  1452. <em>proofs</> (<tt>proof</>), and <em>theorems</> (<tt>theorem</>).
  1453.  
  1454. <code>
  1455. <!element def - - (thtag?, p+) >
  1456. <!element prop - - (thtag?, p+) >
  1457. <!element lemma - - (thtag?, p+) >
  1458. <!element coroll - - (thtag?, p+) >
  1459. <!element proof - - (p+) >
  1460. <!element theorem - - (thtag?, p+) >
  1461. <!element thtag - - (%inline)>
  1462.  
  1463. <!usemap global (def,prop,lemma,coroll,proof,theorem)>
  1464. <!usemap oneline thtag>
  1465. </code>
  1466.  
  1467. With the exception of <tt>proof</>, these all have the same
  1468. structure: an optional <tt>thtag</> followed by some paragraph level
  1469. elements.  Here is an example:
  1470.  
  1471. <theorem><thtag>Alexander's Theorem</>
  1472.  
  1473.  Let [<fi/G/] be a set of nontrivially achievable
  1474. subgoals and < an order on [<fi/G/].  < is
  1475. abstractly indicative if and only if it is a
  1476. linearization of [<lim>< <ll> <fi/G/ <ul>&ast </lim>].
  1477.  
  1478. </theorem>
  1479.  
  1480. This was typed as:
  1481.  
  1482. <verb>
  1483. <theorem><thtag>Alexander's Theorem&et>
  1484.  
  1485.  Let [<fi/G/] be a set of nontrivially achievable
  1486. subgoals and &ero;lt an order on [<fi/G/].  &ero;lt
  1487. is abstractly indicative if and only if it is a
  1488. linearization of 
  1489. [<lim>&ero;lt <ll> <fi/G/ <ul> &ero;ast &et;lim>].
  1490.  
  1491. &et;theorem>
  1492. </verb>
  1493.  
  1494. <sect1> The <tt>global</> Short Reference Map
  1495.  
  1496. <p>
  1497.  The <tt>global</> short reference map, which is the default map in
  1498. effect within <tt>qwertz</> documents, allows the &dquot symbol to be
  1499. used to start a <em>short quote</> (<tt>sq</>) and &lsqb to start a
  1500. <em>formula</> (<tt>f</>).  Also, &tilde is used for non-breaking
  1501. spaces.  The rest of the short references just serve to hide any
  1502. special meaning &TeX gives these characters, allowing them to be
  1503. directly typed without having to use entity references.
  1504.  
  1505. <code>
  1506. <!entity   qtag     '<sq>' >
  1507.  
  1508. <!shortref global
  1509.       "&ero;#RS;B" null  -- delete leading blanks --
  1510.       '"' qtag 
  1511.       "[" ftag
  1512.       "~" nbsp
  1513.       "_" lowbar
  1514.       "#" num
  1515.       "%" percnt
  1516.       "^" circ
  1517.       "{" lcub
  1518.       "}" rcub
  1519.       "|" verbar>
  1520.  
  1521. <!usemap global qwertz>
  1522. </code>
  1523.  
  1524.  
  1525. <sect>Cross References</>
  1526.  
  1527. <p>
  1528. Places within a document can be marked using the <tt>label</>
  1529. element.  Labels have an <tt>id</> attribute for naming the label.
  1530. The SGML parser will check that these identifiers are unique within
  1531. the document, and that they are referenced.  That is, the parser will
  1532. complain if there is no reference to a label.  For this reason, labels
  1533. should probably be created on demand, rather than in anticipation of
  1534. the need for a reference to the element.
  1535.  
  1536. There are two kinds of references: <tt>ref</> for
  1537. references to the number of some element, such as a section, figure or
  1538. theorem, and <tt>pageref</>, for references to the number of the page
  1539. on which the text around the label occurs when the document is
  1540. printed.  Both types of references have an <tt>id</> attribute for
  1541. stating the identifier of the label being referenced.  The number of
  1542. the element or page will be printed at the place of the <tt>ref</> or
  1543. <tt>pageref</>.  
  1544.  
  1545. <code>
  1546. <!element label - o empty>
  1547. <!attlist label id cdata #required>
  1548.  
  1549. <!element ref - o empty>
  1550. <!attlist ref   
  1551.         id cdata #required>
  1552.  
  1553. <!element pageref - o empty>
  1554. <!attlist pageref
  1555.         id cdata #required>
  1556. </code>
  1557.  
  1558. For example, a reference to the section on miscellaneous elements
  1559. of this manual, section <ref id=misc>, would be typed as:
  1560.  
  1561. <verb>
  1562. ... section <ref id=misc>, would be ...
  1563. </verb>
  1564.  
  1565. The label itself was typed as:
  1566.  
  1567. <verb>
  1568. <sect><heading><label id="misc">
  1569.     Miscellaneous Elements&et>
  1570. </verb>
  1571.  
  1572. <sect><heading><label id="misc">Miscellaneous Elements</>
  1573.  
  1574. <p>
  1575.  There are just a couple general purpose elements remaining to be
  1576. discussed, which don't seem to have found a suitable home yet
  1577. elsewhere in this manual.
  1578.  
  1579.  Editorial comments and reminders to oneself can be marked with the
  1580. <tt>comment</> tag.  These comments will be printed using a different
  1581. type style than the body of the text.  In the <tt>qwertz</> mapping
  1582. into &TeX, they are printed using the <sl>slanted type style</>. 
  1583.  
  1584.  If you do not want the comment to be printed, use the standard
  1585. SGML notation for comments instead: <tt><!--  &hellip --></tt>.
  1586.  
  1587.  Finally, there is an "escape" element, allowing you to include raw
  1588. formatting code at any place in your document, the <tt>x</> element.  This
  1589. code will be passed on to the formatter, such as &TeX;, inline, at the point it appears in
  1590. your document.  Of course, this "feature" should be used judiciously, as it limits the formatter
  1591. independence of the document.
  1592.  
  1593. <code>
  1594. <!element comment - - (%inline)>
  1595. <!element x - - ((#pcdata | mc)*) >
  1596. <!usemap   #empty   x >
  1597. </code>
  1598.  
  1599.  Notice that math character (<tt>mc</>) elements may appear within
  1600. <tt>x</> elements.  This allows you to use SGML entity references for
  1601. math characters, to help avoid having to rememember both the SGML and
  1602. the formatter's names for these symbols.  Other entities may also be used, so
  1603. long as they expand to character data.
  1604.  
  1605. <sect>Articles, Reports and Books</>
  1606.  
  1607. <p>
  1608. Articles, reports and books are structurally very similar.  They
  1609. may be formatted differently, of course, but this is of little
  1610. importance during the writing phase of primary interest to authors.
  1611. Seen abstractly, each type of document consists of a <em>title
  1612. page</>, for such information as the title of the document, the names
  1613. of the authors and so on, followed perhaps by an <em>abstract</>, and
  1614. then by a sequence of <em>chapters</> or <em>sections</>.  There may
  1615. be <em>citations</>, which are references to documents listed at the
  1616. end, in a <em>bibliography</>.  Perhaps there are one or more
  1617. <em>appendices</>.  Finally, these documents may also contain
  1618. <em>footnotes</>.   
  1619.  
  1620. Let us first precisely describe the overall structure of these document
  1621. types, before moving on to describe their various components.   The
  1622. article element is defined as:
  1623.  
  1624. <code>
  1625. <!element article - -
  1626.         (titlepag, header?, abstract?, 
  1627.          toc?, lof?, lot?, p*, sect*, 
  1628.          (appendix, sect+)?, biblio?) +(footnote)>
  1629.  
  1630. <!attlist article
  1631.         opts cdata "null">
  1632. </code>
  1633.  
  1634. The <em>options</> attribute (<tt>opts</>) of <tt>article</>
  1635. provides a place to state <em>formatting</> options, which are passed
  1636. on to &LaTeX;.    The particular options available depends on the
  1637. installation of &LaTeX being used, but the following should
  1638. always be available:
  1639.  
  1640. <descrip>
  1641. <tag><tt>11pt, 12pt.</></tag>
  1642.  
  1643.  Set the "normal" font size to eleven, or twelve, point, instead of
  1644. the default 10 point size.
  1645.  
  1646. <tag><tt>twoside.</></tag>
  1647.  
  1648.  Formats the document for printing on both sides of a page.
  1649.  
  1650. <tag><tt>twocolumn.</></tag>
  1651.  
  1652.  Formats the document with two columns per page, as is common in
  1653. the proceedings of scientific conferences, for example.
  1654.  
  1655. <tag><tt>titlepage.</></tag>
  1656.  
  1657.  Causes the title page  and abstract to be printed on a
  1658. separate page.
  1659.  
  1660. </descrip>
  1661.  
  1662. Other options which may be supported include:
  1663.  
  1664. <descrip>
  1665. <tag><tt>dina4.</></>
  1666.  
  1667. Formats the document for printing on <bf/DIN A4/ size paper.  (As
  1668. this is the size paper used at our installation, this option is
  1669. included automatically during the translation.)
  1670.  
  1671. <tag><tt>german.</></tag>
  1672.  
  1673. Causes the &TeX hyphenation algorithm to "think German", and
  1674. sections, bibliographies and such to be labelled using the
  1675. appropriate German terms.
  1676.  
  1677. <tag><tt>times, bookman, palatino …</tt></>
  1678.  
  1679. Causes the "main" font to be the selected PostScript font, instead
  1680. of the standard &TeX font, Computer Modern, and maps all other type faces
  1681. to some suitable PostScript font or type style.  
  1682.  
  1683. </descrip>
  1684.  
  1685. For example, the starting tag for some article might be:
  1686.  
  1687. <verb>
  1688. <article opts="bookman,11pt">
  1689. </verb>
  1690.  
  1691. Reports are just like articles, except that they consist of a
  1692. sequence of chapters (<tt>chapt</>), instead of sections
  1693. (<tt>sect</>):
  1694.  
  1695. <code>
  1696. <!element report - - 
  1697.         (titlepag, header?, abstract?, toc?, lof?, lot?, p*,
  1698.          chapt*, (appendix, chapt+)?, biblio?) +(footnote)>
  1699.  
  1700. <!attlist report
  1701.         opts cdata "null">
  1702. </code>
  1703.  
  1704. Books are similar to reports, except that they may not include an
  1705. abstract:
  1706.  
  1707. <code>
  1708. <!element book  - - 
  1709.         (titlepag, header?, toc?, lof?, lot?, p*, chapt*, 
  1710.          (appendix, chapt+)?, biblio?) +(footnote) >
  1711.  
  1712. <!attlist book
  1713.         opts cdata "null">
  1714. </code>
  1715.  
  1716. The options attribute (<tt>opt</>) for <tt>report</> and
  1717. <tt>book</> elements is the same as that for articles, just described,
  1718. except the <tt>titlepage</> option, which is applicable only for
  1719. articles.
  1720.  
  1721.  
  1722. The rest of this chapter describes the common elements of articles,
  1723. reports and books, starting with title pages.
  1724.  
  1725. <sect1>Title Pages</>
  1726.  
  1727. <p>
  1728. A title page (<tt>titlepag</>) consists of a title, a number of
  1729. authors (<tt>author</>) and an optional date (<tt/date/).  The title
  1730. may refer to a footnote and may also include a <tt>subtitle</>.  If
  1731. the date element is omitted, today's date will be printed by default.
  1732. To avoid having a date printed, include an empty <tt/date/ element.
  1733.  
  1734. <code>
  1735. <!element titlepag o o (title, author, date?)>
  1736. <!element title - o (%inline, subtitle?) +(newline)>
  1737. <!element subtitle - o (%inline)>
  1738. <!usemap oneline titlepag>
  1739. </code>
  1740.  
  1741. The <tt>author</> element includes the <tt>name</> and, optionally,
  1742. institution (<tt>inst</>) of the author.  If there are multiple
  1743. authors, these are separated with the <tt>and</> tag.   Also,
  1744. acknowledgements can be expressed using the <tt>thanks</> element.
  1745. These are formatted by &LaTeX as footnotes on the title page.The <tt>author</> element includes the <tt>name</> and, optionally,
  1746. institution (<tt>inst</>) of the author.  If there are multiple
  1747. authors, these are separated with the <tt>and</> tag.   Also,
  1748. acknowledgements can be expressed using the <tt>thanks</> element.
  1749. These are formatted by &LaTeX as footnotes on the title page.
  1750.  
  1751. <code>
  1752. <!element author - o (name, thanks?, inst?, 
  1753.                         (and, name, thanks?, inst?)*)>
  1754. <!element name o o (%inline) +(newline)>
  1755. <!element and - o empty>
  1756. <!element thanks - o (%inline)>
  1757. <!element inst - o (%inline) +(newline)>
  1758. <!element date - o (#pcdata)>
  1759. <!usemap global thanks>
  1760. </code>
  1761.  
  1762. Within the <tt>titlepag</>, the <tt>title</>, <tt>subtitle</>,
  1763. <tt>author</> and <tt/inst/ elements can be broken into multiple lines
  1764. using the <tt>newline</> element or, if you prefer, the <tt>nl</>
  1765. entity.
  1766.  
  1767. <code> 
  1768. <!element newline - o empty >
  1769. <!entity nl "<newline>"> 
  1770. </code>
  1771.  
  1772. The title page of this manual was typed as:
  1773.  
  1774. <verb>
  1775. <title>The <tt/qwertz/ SGML Document Types
  1776. <subtitle>(Version 1.1 Reference Manual)
  1777. <author>Tom Gordon
  1778. <inst> Institute for Applied Information Technology (F3) &ero;nl&ero;nl
  1779.     German National Research Center  &ero;nl
  1780.            for Computer Science (GMD)
  1781. </verb>
  1782.  
  1783. Notice the <tt>titlepag</> tags are optional. The simplest title
  1784. page would include a title and author:
  1785.  
  1786. <verb>
  1787. <title> A Very Short Title Page
  1788. <author> Snoopy
  1789. </verb>
  1790.  
  1791. <sect1>Abstracts</>
  1792.  
  1793. <p>
  1794. Articles and reports, but not books, may have an abstract, which
  1795. consists of one or more paragraphs, including the various kinds of
  1796. lists, mathematical formulas and elements for literate programming:
  1797.  
  1798. <code>
  1799. <!element abstract - - (p+)>
  1800. </code>
  1801.  
  1802. <sect1>Table of Contents</>
  1803.  
  1804. <p>
  1805. There are three elements for stating whether or not a table of
  1806. contents, list of figures or list of tables should be included in the
  1807. document.  These tables and lists are generated by &LaTeX;.  Therefore
  1808. the contents of these elements is empty.  They are only used to
  1809. specify that the list or table should be included.
  1810.  
  1811. <code>
  1812. <!element toc - o empty>
  1813. <!element lof - o empty>
  1814. <!element lot - o empty>
  1815. </code>
  1816.  
  1817. <sect1>Headers</>
  1818.  
  1819. <p>
  1820. A <tt>header</> element specifies what should be printed at the top
  1821. of each page.  It consists of a left heading (<tt>lhead</>) and a
  1822. right heading (<tt>rhead</>).  Both elements are required, if a heading is
  1823. used at all, but either may be left empty, so that the effect of
  1824. having only a left or right heading can be achieved easily enough.
  1825.  
  1826. <code>
  1827. <!element header - - (lhead, rhead) >
  1828. <!element lhead - o (%inline)>
  1829. <!element rhead - o (%inline)>
  1830. </code>
  1831.  
  1832. As we will see, an initial header can be given after the title
  1833. page.  Afterwards, a new header can be given for each new chapter or
  1834. section.  The header printed on a page is the one which is in effect
  1835. at the end of the current page.  So that the header will be that of
  1836. the last section starting on the page.
  1837.  
  1838. <sect1>Sectioning</>
  1839.  
  1840. <p>
  1841. The naming scheme we have adopted for sections is a bit different
  1842. than that of &LaTeX;, because the names of SGML identifiers may be
  1843. at most only eight characters long.  But we think the scheme we have
  1844. chosen has its advantages.   In books and reports, the top-level
  1845. sectional unit is the <em>chapter</> (<tt>chapt</>).  In articles, it
  1846. is the <em>section</> (<tt>sect</>).  The lower sectional units are
  1847. <tt>sect1</>, <tt>sect2</>, <tt>sect3</>, and <tt>sect4</>, in that
  1848. order. 
  1849.  
  1850. Each section (or chapter) consists of a <tt>heading</>, followed by
  1851. an optional <tt>header</>, a number of paragraphs (including such things as
  1852. graphics), and then sections of the next lower level. 
  1853.  
  1854. <code>
  1855. <!entity % sect "heading, header?, p* " >
  1856. <!element heading o o (%inline)>
  1857. <!element chapt - o (%sect, sect*) +(footnote)> 
  1858. <!element sect  - o (%sect, sect1*) +(footnote)>
  1859. <!element sect1 - o (%sect, sect2*)>
  1860. <!element sect2 - o (%sect, sect3*)>
  1861. <!element sect3 - o (%sect, sect4*)>
  1862. <!element sect4 - o (%sect)>
  1863. <!usemap oneline (chapt,sect,sect1,sect2,sect3,sect4)>
  1864. </code>
  1865.  
  1866.  Don't confuse the headers with headings.  The <tt>heading</> is
  1867. just the text printed at the point where the section begins, naming
  1868. the section.  The <tt>header</> changes the text printed at the top of
  1869. each page.
  1870.  
  1871. If there are cross references to the section, put the
  1872. <tt>label</> in the heading.  For example, you could type:
  1873.  
  1874. <verb>
  1875. <sect><heading><label id=mysect>My First Section&et>
  1876. </verb>
  1877.  
  1878. If a label isn't required, you can leave the <tt>heading</> tag
  1879. implicit:
  1880. <verb>
  1881. <sect>My First Section
  1882. </verb>
  1883.  
  1884. The <tt>appendix</> element marks the begin of a sequence of
  1885. appendices.  These are chapters or sections, depending on whether the
  1886. document is an article, report or book, and differ from ordinary
  1887. chapters or sections only in the way the are numbered, and of course
  1888. their placement at the end of the document.
  1889.  
  1890. <code>
  1891. <!element appendix - o empty >
  1892. </code>
  1893.  
  1894. <sect1>Footnotes</>
  1895.  
  1896. <p>
  1897. The tag for footnotes is, simply enough,
  1898. <tt>footnote</>.<footnote>To be sure the marker for the footnote is
  1899. formatted propertly, be sure not to leave a space between the
  1900. character after which the footnote marker is to appear and the
  1901. beginning of the footnote element itself.</>
  1902.  
  1903. <code>
  1904. <!element footnote - - (%inline)>
  1905. <!usemap global footnote>
  1906. </code>
  1907.  
  1908. Footnotes can appear anywhere within a section (or chapter).  The
  1909. <tt>usemap</> declaration is required to cancel the <tt>lines</> map
  1910. used in title pages.
  1911.  
  1912. <sect1>Citation</>
  1913.  
  1914. <p>
  1915. Literature references can be made using the <tt>cite</> and
  1916. <tt>ncite</> elements.  The only difference between them is that the
  1917. <tt>ncite</> allows a short <em>note</> to be included in the
  1918. reference, for such things as page numbers.
  1919.  
  1920. <code>
  1921. <!element cite - o empty>
  1922. <!attlist cite 
  1923.         id cdata #required>
  1924.  
  1925. <!element ncite - o empty>
  1926. <!attlist ncite 
  1927.         id cdata #required
  1928.         note cdata #required>
  1929. </code>
  1930.  
  1931. For example, one might type 
  1932. <verb>
  1933.     <ncite id="Bryan88" note="pg.68">
  1934. </verb> 
  1935. to refer to page 88 of Martin Bryan's
  1936. book on SGML.  This would appear, using &LaTeX, as <ncite id="Bryan88"
  1937. note="pg. 68"> in the printed document.
  1938.  
  1939. The <tt>id</> attribute of a <tt>cite</> or <tt>ncite</> is a
  1940. reference to an identifier of a Bib&TeX bibliography file.  There is a
  1941. <tt>qwertz</> SGML document type for creating such bibliographies,
  1942. described below.
  1943.  
  1944. The bibliography itself, or list of references, is generated by
  1945. including a <tt>biblio</> element near the end of the document, before
  1946. the appendix.
  1947.  
  1948. <code>
  1949. <!element biblio - o empty>
  1950. <!attlist biblio
  1951.     style cdata "qwertz"
  1952.         files cdata "">
  1953. </code>
  1954.  
  1955.  The <tt>files</> attribute of <tt>biblio</> is a list of the names
  1956. of the bibliographies used, separated by commas.  The names should not
  1957. include any file suffixes, such as ".bib" or ".sgml".   For example,
  1958. to cite publications on artificial intelligence and cognitive
  1959. science, where the bibliograhies are maintained in two files,
  1960. <tt>ai.sgml</> and <tt>cogsci.sgml</>, you would type:
  1961.  
  1962. <verb>
  1963. <biblio files="ai,cogsci">
  1964. </verb>
  1965.  
  1966.  The <tt>style</> attribute determines how the bibliography is
  1967. formatted.  Five styles are supported:
  1968.  
  1969. <descrip>
  1970. <tag><tt>plain</>
  1971.  
  1972.  Entries are sorted alphabetically and labeled with numbers.
  1973.  
  1974. <tag><tt>unsrt</>
  1975.  
  1976.  The same as <tt>plain</> except the entries are ordered as they
  1977. appear in the document, rather than alphabetically.
  1978.  
  1979. <tag><tt>alpha</>
  1980.  
  1981.  The same as <tt>plain</>, except that labels are made from the author's
  1982. name and the year of publication.
  1983.  
  1984. <tag><tt>abbrv</>
  1985.  
  1986.  The same as <tt>plain</> except that first names, month names, and
  1987. journal names are abbreviated.
  1988.  
  1989. <tag><tt>qwertz</>
  1990.  
  1991.  The same as <tt>plain</> except that all words of the entry are
  1992. capitalized exactly as they appear in the source file of the
  1993. bibliography.  The <tt>plain</> style applies capitalization rules
  1994. which are inappropriate, e.g., for German titles.
  1995.  
  1996. </descrip>
  1997.  
  1998. <sect>Slides
  1999.  
  2000. <p>
  2001. The <tt>slides</> element is for making a series of slides or, more
  2002. commonly, overhead transparencies.  Although you may often prefer to
  2003. use some other program for preparing presentations, this approach has
  2004. its advantages when you want to include parts of an existing article
  2005. or book on your transparencies. You can just "cut and paste" the SGML
  2006. source from an article onto a slide.  You may also prefer this
  2007. approach if your presentation includes mathematical formulas, to be
  2008. able to take advantage of &TeX's excellent mathematics typesetting.
  2009.  
  2010. <code>
  2011. <!element slides - - (slide*) >
  2012.  
  2013. <!attlist slides
  2014.     opts cdata "null">
  2015. </code>
  2016.  
  2017. Each slide consists of an optional title, followed by one or more
  2018. <tt>slpar</> elements:
  2019.  
  2020. <code>
  2021. <!element slide - o (title?, p+) >
  2022. </code>
  2023.  
  2024. Notice that not every element available in an article or book is also
  2025. available here.  In particular, there are no sectioning elements,
  2026. cross references, footnotes or a bibliography.<footnote>Our
  2027. translation into &TeX does not use Sli&TeX;, so as to allow slides to
  2028. include tables and figures.  </footnote>
  2029.  
  2030. The <tt>title</> element will be centered on the line.  You can break
  2031. up the title into multiple lines with <tt>newline</> elements.  The
  2032. various type style elements, such as <tt>em</> and <tt>bf</>, can also
  2033. be used here; indeed anywhere on a slide.  
  2034.  
  2035. <sect> Letters and Electronic Messages
  2036.  
  2037. <p>
  2038. The <tt>letter</> element is for making letters and e-mail
  2039. messages.  Just how a letter is formatted may depend on whether it is
  2040. a business or personal letter.  If it is a business letter, it may be
  2041. printed to appear as if the company's letterhead stationery had been
  2042. used.
  2043.  
  2044. The structure of a letter can be quite complex, but most the
  2045. elements to be described here are optional.  Using an example from
  2046. <cite id="Lamport86">, a simple letter would be typed like this:
  2047.  
  2048. <verb>
  2049. <letter>
  2050. <from> 
  2051.     R. (Ma) Dillo 
  2052.     <address> 1234 Ave.~of the Armadillos &ero;nl
  2053.           Gnu York, G.Y. 56789
  2054. <to>    
  2055.     Dr.~G. Nathaniel Picking
  2056.     <address> Acme Exterminators &ero;nl
  2057.               33 Swat Street &ero;nl
  2058.               Hometown, Illinois 62301
  2059.     
  2060. <cc> Jimmy Carter &ero;nl
  2061.      Richard M. Nixon
  2062.     
  2063. <opening> Dear Nat,
  2064.         
  2065.  I'm afraid that the armadillo problem is still 
  2066. with us.  I did everything ... 
  2067.         
  2068.  ... and I hope we can get rid of the nasty beasts 
  2069. this time.
  2070.         
  2071. <closing> Best regards,
  2072.         
  2073. &et;letter>
  2074. </verb>
  2075.  
  2076. The <tt>from</> and <tt>to</> elements are for the sender's and
  2077. receiver's names and addresses, respectively.  The address may be
  2078. either a street address, using <tt/address/, or an electronic mail
  2079. address, using <tt/email/, or both.  You may also include a telephone
  2080. number, using the <tt/phone/ element. (If you are using your company's
  2081. letterhead stationery, it may be that you should type only your
  2082. extension, rather than your complete telephone number.) Finally, a
  2083. telefax number can be provided, using the <tt/fax/ element.
  2084.  
  2085. Notice that in the <tt>closing</> you must type a comma yourself,
  2086. if you want one.  Also, do not type your name again after the closing;
  2087. the <tt>name</> of the sender will be printed after the closing as
  2088. expected.
  2089.  
  2090. There are several optional elements which may be of interest:
  2091.  
  2092. <descrip>
  2093. <tag><tt>subject</>
  2094.  
  2095.  For the purpose or, well, subject of the letter.   If you would
  2096. like this subject line to appear as "re: &hellip", for example, you
  2097. must type the "re: " yourself, as part of the subject.   
  2098.  
  2099. <tag><tt>sref, rref, rdate</>
  2100.  
  2101.  These are tags for the <em>sender's reference</>, <em>receiver's
  2102. reference</> and <em>receiver's date</> where you can include whatever
  2103. code is used by your, or the recipient's, company or institution to
  2104. uniquely identify letters.  For example, if this letter is a response
  2105. to some other letter, you may use the <tt>rref</> and <tt>rdate</>
  2106. elements to identify the original letter.  There is no <tt>sdate</>
  2107. tag, as the date this letter is printed will be included in the letter
  2108. at some appropriate place by the formatter.
  2109.  
  2110. <tag><tt>cc</>
  2111.  
  2112. This used to be an acronym for "carbon copies", which were to be
  2113. sent to persons other than the principal recipient of the letter.  The
  2114. <tt>cc</> tag can be used to list these other recipients, even though
  2115. the copies they receive today are perhaps printed by a laser printer
  2116. on recycled paper.  As in the above example, you can separate the
  2117. names of these recipients with <tt>newline</> elements (using the
  2118. <tt>nl</> entity if you prefer).
  2119.  
  2120. <tag><tt>encl</>
  2121.  
  2122. Use this tag to list <em>enclosures</>.  These can also be separated
  2123. with <tt>newline</> elements, or simply with commas, if you prefer.
  2124.  
  2125. <tag><tt>ps</>
  2126.  
  2127.  A postscript, not to be confused with PostScript, can be included
  2128. with this tag.  Any kind of element which can appear in the body
  2129. of the letter (i.e. <tt>sectpar</> elements) can also be used here.
  2130.  
  2131. </descrip>
  2132.     
  2133. To summarize, here are the relevant SGML declarations:
  2134.  
  2135. <code>
  2136. <!entity  % addr "(address?, email?, phone?, fax?)" >  
  2137.     
  2138. <!element letter - - 
  2139.     (from, %addr, to, %addr, cc?, subject?, sref?, rref?,
  2140.          rdate?, opening, p+, closing, encl?, ps?)>
  2141.  
  2142. <!attlist letter
  2143.     opts cdata "null">
  2144.     
  2145. <!element from        - o (#pcdata) >
  2146. <!element to        - o (#pcdata) >
  2147.     
  2148. <!usemap oneline (from,to)>
  2149.     
  2150. <!element address     - o (#pcdata) +(newline) >
  2151. <!element email        - o (#pcdata) >
  2152. <!element phone        - o (#pcdata) >
  2153. <!element fax        - o (#pcdata) >
  2154.     
  2155. <!element subject     - o (%inline;) >
  2156. <!element sref        - o (#pcdata) >
  2157. <!element rref          - o (#pcdata) >
  2158. <!element rdate         - o (#pcdata) >
  2159.     
  2160. <!element opening     - o (%inline;) >
  2161. <!usemap oneline opening>
  2162.     
  2163. <!element closing - o (%inline;) >
  2164. <!element cc - o (%inline;) +(newline) >
  2165. <!element encl - o (%inline;) +(newline) >
  2166.     
  2167. <!element ps - o (p+) >
  2168. </code>
  2169.  
  2170.  
  2171. <sect> Telefax Messages
  2172.  
  2173. <p>
  2174. The structure of a telefax message is the same as for letters and
  2175. e-mail messages, except that the <tt/fax/ number of the recipient is,
  2176. of course, required, rather than optional.
  2177.  
  2178. <code>
  2179. <!element telefax - - 
  2180.     (from, %addr, to, address, email?, 
  2181.          phone?, fax, cc?, subject?, 
  2182.      sref?, rref?, rdate?,
  2183.          opening, p+, closing, ps?)>
  2184.  
  2185. <!attlist telefax 
  2186.     opts cdata "null"
  2187.     length cdata "2">
  2188. </code>
  2189.  
  2190. <sect> Notes 
  2191.  
  2192. <p>
  2193. The <tt/notes/ element is a new top-level document "style", like
  2194. articles, books and letters.  It is useful for miscellaneous purposes,
  2195. such as jotting down notes to oneself, where the complex structure of
  2196. the other styles is unnecessary.  Notes here simply a sequence of
  2197. section paragraphs (i.e. paragraphs, lists, comments, long quotations,
  2198. figures, tables, displayed mathematical formulas, and program code).
  2199. An optional title is also available.  The contents of a notes document
  2200. can be copied and pasted into a section or chapter of a book or article.
  2201.  
  2202. <code>
  2203. <!element notes - - (title?, p+) >
  2204. <!attlist notes
  2205.     opts cdata "null" >
  2206. </code>
  2207.  
  2208. <sect> Manual Pages
  2209.  
  2210. <p>
  2211. The <tt>manpage</> element is for Unix manual pages.  Here we see again
  2212. an advantage of SGML.  Using this element, the very same manual
  2213. page can be viewed on just about every terminal, using <tt>nroff</>,
  2214. or be included as a section of an article, report or book to be
  2215. formatted by &TeX;. 
  2216.  
  2217. <code>
  2218. <!element manpage - - (sect1*) 
  2219.     -(sect2 | f | %mathpar | figure | tabular | 
  2220.           table | %xref | %thrm )>
  2221.  
  2222.  
  2223. <!attlist manpage
  2224.     opts cdata "null"
  2225.     title cdata ""
  2226.     sectnum cdata "1" >
  2227. </code>
  2228.  
  2229.  A manpage consists of a sequence of sections.  There are two SGML
  2230. attributes, for the command name and manual section number,
  2231. respectively.  Each section of the manual page is delimited by a
  2232. <tt>sect1</> element.  <em/Notice that these sections may not contain
  2233. further subsections./   Sections are represented as <tt>sect1</>
  2234. elements, rather than <tt>sect</>, to allow the manual page to be
  2235. easily cut and pasted into a <tt>sect</> section of an article, report
  2236. or book.  (Of course, if the manual page is to be used a chapter of a
  2237. book, then these sections of the manual page will need to be replaced
  2238. with <tt>sect</> elements.)
  2239.  
  2240.  Notice that Many elements, such as tables, figures and
  2241. mathematical formulas, cannot be used within manual pages, because of
  2242. limitations of ASCII terminals, or the Unix <tt/man/ macro package for
  2243. <tt/nroff/.
  2244.  
  2245.  There is a short reference map in effect within the scope of the
  2246. <tt>manpage</>.  With the exception of [, which is not used here
  2247. to start formulas, this map <em>has the same effect</> as the
  2248. <tt>global</> map.
  2249.  
  2250. <code>
  2251. <!shortref manpage
  2252.       "&ero;#RS;B" null
  2253.       '"' qtag 
  2254.       "[" ftag
  2255.       "~" nbsp
  2256.       "_" lowbar
  2257.       "#" num
  2258.       "%" percnt
  2259.       "^" circ
  2260.       "{" lcub
  2261.       "}" rcub
  2262.       "|" verbar>
  2263.  
  2264. <!usemap manpage  manpage >
  2265. </code>
  2266.  
  2267. <sect1> Manual Page Conventions
  2268.  
  2269. <p>
  2270.  For detailed information about the conventions for Unix manual
  2271. pages, see your Unix documentation.  But here is a brief summary.  The
  2272. typical manual page has the following sections, in this order:
  2273.  
  2274. <descrip>
  2275. <tag> NAME.
  2276.  
  2277.  The name, or list of names, by which the command or function is
  2278. called, followed by a dash and then a one-line summary of its purpose.
  2279.  
  2280. <tag> SYNOPSIS.
  2281.  
  2282.  For the syntax of the command and its arguments. (The Sun
  2283. documentation suggests that literals be formatted using boldface type,
  2284. and that variables be formatted using italics type.  Use the <tt>tt</>
  2285. and <tt>em</> elements, respectively, here for this purpose.)
  2286.  
  2287. <tag> DESCRIPTION.
  2288.  
  2289.  An overview of the command or function's purpose, effects and use.
  2290.  
  2291. <tag> OPTIONS.
  2292.  
  2293.  A list and description of all command-line options.
  2294.  
  2295. <tag> FILES.
  2296.  
  2297.  A list of files associated with the command which may be of
  2298. interest to users.
  2299.  
  2300. <tag> SEE ALSO.
  2301.  
  2302.  A comma-separated list of related Unix commands, and references to
  2303. other relevant publications.
  2304.  
  2305. <tag> DIAGNOSTICS.
  2306.  
  2307.  A list and explanation of any diagnositic messages the command may
  2308. write to the standard error output file.
  2309.  
  2310.  
  2311. <tag> BUGS.
  2312.  
  2313.  A description of any known bugs, problems, or limitations.
  2314.  
  2315. </descrip>
  2316.  
  2317.  Some of you may be asking yourselves why <tt>manpage</> wasn't
  2318. designed so that each of these conventional sections of a manual page
  2319. is represented by its own SGML element.  That certainly would have
  2320. been possible, but on the other hand the approach taken has the
  2321. advantage that users can simply cut and paste sections between manual
  2322. pages and article, reports and books.  Of course it would have been
  2323. easy to write a filter to convert between these formats, but it was
  2324. felt that the benefits of a special <tt>manpage</> format would be too
  2325. small to warrant even this limited effort.  After all, unless one is
  2326. using an SGML structure editor, users must refer to the SGML document
  2327. type definition to know what is expected in the manual page.  It is
  2328. just as easy to check this documentation to see what sections
  2329. conventionally appear in manual pages.  There is also a file which can
  2330. be used as a template or form for writing manual pages.  See the Unix
  2331. Commands chapter for details.
  2332.  
  2333.  The only reason there is a <tt>manpage</> document type, instead
  2334. of just another translation of, say, the <tt>article</> document type
  2335. into <tt>nroff</> is that the <tt>man</> macros used for the Unix
  2336. documentation are not powerful enough to format all of the features
  2337. available in our <tt>latex</> document type.  Having this separate
  2338. <tt>manpage</> document type provides a means of checking whether the
  2339. manual page can be formatted by <tt>nroff</> using these <tt>man</>
  2340. macros.  Again, as this document type is designed to be a subset of
  2341. the <tt>latex</> document type, the sections of a manual page can also
  2342. be included within instances of the <tt>latex</> document type.
  2343.  
  2344. <sect1> Manual Page Example
  2345.  
  2346. <p> Here is how the manual page for the <tt>cd</> command could have
  2347. been typed using this document type definition:
  2348.  
  2349. <verb>
  2350. <manpage title="CD">
  2351.     
  2352. <sect1> NAME
  2353.     
  2354. <p>cd &ero;mdash change working directory
  2355.     
  2356. <sect1> SYNOPSIS
  2357.     
  2358. <p> cd [ <em>directory&et;> ] 
  2359.     
  2360. <sect1> DESCRIPTION
  2361.     
  2362. <p> <em>directory&et;> becomes the new working directory.  The process
  2363. must have execute (search) permission in <em>directory&et;>.  If cd is
  2364. used without arguments, it returns you to your login directory.
  2365.     
  2366. ...
  2367.     
  2368. <sect1> SEE ALSO
  2369.     
  2370. <p> csh(1), pwd(1), sh(1)
  2371. &et;manpage>
  2372. </verb>
  2373.  
  2374.  This is the end of the <tt>qwertz</> document type definition.
  2375.  
  2376. <code>
  2377. <!-- end of qwertz dtd -->
  2378.  
  2379. </code>
  2380.  
  2381.